package com.t.bricks.bussiness.service.tablekey.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.t.bricks.bussiness.db.dao.tablekey.TableKeyDao;
import com.t.bricks.bussiness.db.entity.tablekey.TableKey;
import com.t.bricks.bussiness.service.tablekey.TableKeyService;

/**
 * 记录编号序列管理表'TableKey表'基本业务操作类接口实现
 */
@Service
public class TableKeyServiceImpl implements TableKeyService<TableKey> {

	@Autowired
	private TableKeyDao<TableKey> tableKeyDao;
	
	/**
	 * 取各表的新Id
	 * @param formatLong 格式化长度(不足长度+0)
	 * @param seriesName
	 * @return
	 */
	@Override
	public String getNewId(int formatLong, String seriesName) {
		return tableKeyDao.getNewId(formatLong, seriesName);
	}
	
	/**
	 * 取各表的一批新Id
	 * @param formatLong 格式化长度(不足长度+0)
	 * @param seriesName
	 * @param size 数量
	 * @return
	 */
	@Override
	public List<String> getNewIds(int formatLong, String seriesName, int size) {
		return tableKeyDao.getNewIds(formatLong, seriesName, size);
	}
	
	/**
	 * 重置
	 * @param seriesName
	 * @return
	 */
	@Override
	public String reset(String seriesName) {
		return tableKeyDao.reset(seriesName);
	}
	
}
